const http = require('../../utils/http.js')
/**
 * 3行单元格
 */
Component({
  options: {
    addGlobalClass: true,
  },
  /**
   * 组件的属性列表
   */
  properties: {
    itemList: Object,
    activityId: Number
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    itemClick(e) {
      let item = e.currentTarget.dataset;
      http.get('/api/index/checkActivity', {activityId: this.properties.activityId}).then(res => {
        if (res.code == 200) {
          wx.navigateTo({
            url: '/pages/home/couponDetail/index?stockId=' + item.stockId
          });
        }else {
          wx.showToast({
            title:res.message,
            icon:'none'
          })
        }
      })
    }
  }
})
